﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PubSubLite.IOC
{
    /// <summary>
    /// Represents a collection of type mappings
    /// </summary>
    public abstract class TypeMappingsModule
    {
        public TypeMappingsModule()
        {
            TypeMappings = new List<ITypeMapping>();
        }

        protected List<ITypeMapping> TypeMappings
        {
            get;
            private set;
        }

        /// <summary>
        /// The available Type mappings
        /// </summary>
        public IEnumerable<ITypeMapping> Mappings
        {
            get { return TypeMappings; }
        }

        protected void RegisterMapping<T, T2>(string name)
        {
            TypeMappings.Add(new TypeMapping<T, T2>(name));
        }
    }
}
